package setting

import "github.com/gin-gonic/gin"

type LogDriver string

const (
	File    LogDriver = "file"
	Console LogDriver = "console"
	DB      LogDriver = "sqlite"
)

type LoggerConfig struct {
	// 日志文件名
	Name string
	// 日志存放目录
	Dir string
	// 日志写入类型 file|db|console
	Type LogDriver
	// 按天拆分日志
	ByDay bool
	// 是否同时打印在控制台
	PrintConsole bool
}

type LogWriter interface {
	Info(*gin.Context, string)
	Warn(*gin.Context, string)
	Fail(*gin.Context, string)
	Custom(*gin.Context, string, string)
	Close()
	OpenTrace()
}
